package main

import "fmt"

var (
	barVal = map[string]int{"alpha": 34, "bravo": 56, "charlie": 23,
		"delta": 87, "echo": 56, "foxtrot": 12,
		"golf": 34, "hotel": 16, "indio": 87,
		"juliet": 65, "kili": 43, "lima": 98}
)

func main() {

	invMap := make(map[int]string, len(barVal))
	for k, v := range barVal {
		invMap[v] = k
	}

	fmt.Println("K-V 对调前： ")
	for k, v := range barVal {
		fmt.Printf("key : %s  value : %d \n", k, v)
	}

	fmt.Println("K-V 对调后： ")
	for k, v := range invMap {
		fmt.Printf("key : %d  value : %s \n", k, v)
	}
}
